package com.hgyc.mom.eam.entity;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;

import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * <p>
 * 设备台账
 * </p>
 *
 * @author fwj
 * @since 2025-08-10
 */
@Data
@TableName("eam_equipment")
@Schema(name="设备台账对象", description="设备台账对象")
public class EamEquipment implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    @Excel(name = "设备编码")
    @Like
    @Schema(description = "设备编码")
    private String code;

    @Excel(name = "设备名称")
    @Schema(description = "设备名称")
    private String name;

    @Excel(name = "设备类型")
    @EQ
    @Schema(description = "设备类型")
    @TableDict(table = "eam_equipment_type", key = "id" , columns = {
            @DictColumn(name ="name", alias = "typeName"),
    })
    private Long type;

    @Excel(name = "设备型号")
    @Schema(description = "设备型号")
    private String model;

    @Excel(name = "设备图片")
    @Schema(description = "设备图片")
    private Long image;

    @Excel(name = "车间")
    @EQ
    @Schema(description = "车间")
    @TableDict(table = "mes_workshop", key = "id" , columns = {
            @DictColumn(name ="name", alias = "workshopName"),
    })
    private Long workshopId;

    @Excel(name = "资产编码")
    @EQ
    @Schema(description = "资产编码")
    private String resourceCode;

    @Excel(name = "设备负责人")
    @Schema(description = "设备负责人")
    @TableDict(table = "sys_user", key = "id", columns = {
            @DictColumn(name = "name", alias = "resourceOwnerName")
    })
    private Long resourceOwner;

    @Excel(name = "入库日期")
    @Schema(description = "入库日期")
    private LocalDate stockInDate;

    @Excel(name = "供应商")
    @Schema(description = "供应商")
    private String supplier;

    @Excel(name = "机身编号")
    @EQ
    @Schema(description = "机身编号")
    private String machineCode;

    @Excel(name = "使用年限", readConverterExp = "年=")
    @Schema(description = "使用年限（年）")
    private Long durableYears;

    @Excel(name = "保修截止日期")
    @Schema(description = "保修截止日期")
    private LocalDate warrantyExpirationDate;

    @Excel(name = "虚拟设备")
    @Schema(description = "虚拟设备")
    private Integer virtualDevice;

    @Excel(name = "重点设备")
    @Schema(description = "重点设备")
    private Integer keyEquipment;

    @Excel(name = "使用状态")
    @Schema(description = "使用状态")
    private String useStatus;

    @Schema(description = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新人")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

}
